<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>补班确认新增</title>
</head>
<body>
	<script type="text/javascript">
		$(function() {
			/* 清单查找 */
			$('#sheet_user_zhi').textbox({
				icons : [ {
					iconCls : 'icon-add',
					handler : function(e) {
						$("#findemp").dialog("open");
						//双击获取值
						$('#one_shet').datagrid({onDblClickRow:function(index,row){
								var paperinsertid=row.STAIN_ID;
								var paperinsertname=row.STAIN_NAME;
								$('#sheet_user_zhi').textbox("setValue",paperinsertid);
								$('#sheet_user_name').textbox("setValue",paperinsertname);
								//关闭窗口
								$('#findemp').dialog('close');
							}
						});
					}
				}]
			});

			//返回
			$('.returnet').linkbutton({
				onClick : function() {
					$("#shetsuper").panel({
						href : "data_operation"
					});
				}
			});
			$(".submit_sheet_addsuper").linkbutton({onClick:function(){
				if($("#sheet_user_zhi").textbox("getText")==""||$("#affcaet").combobox("getValue")==""||
						$("#leasheet").combobox("getValue")==""|| $("#oneee").datetimebox("getText")==""||$("#tweee").datetimebox("getText")==""||$("#yuanyings").textbox("getText")==""){
					$.messager.alert('提示', '请填写全部内容');
				}else{
				$("<form method='post'>").appendTo(document.body).form({
					url: 'shq_options_bubanadds',
					onSubmit: function(params){
						params["stainId"] = $("#sheet_user_zhi").textbox("getText");
						params["affcaId"] = $("#affcaet").combobox("getValue");
						params["holidayId"] = $("#leasheet").combobox("getValue");
						params["conaffEndtdate"] = $("#oneee").datetimebox("getText");
						params["conaffStartdate"] = $("#tweee").datetimebox("getText");
						params["conaffReason"] = $("#yuanyings").textbox("getText");
					},
					success:function(v){
						v = eval("(" + v + ")");
						if(v.success){
							$("#shetsuper").panel({
								href : "data_operation"
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
						}
					}
				}).submit();
				}
			}
			});
			
		});
		//所有部门
		$('#supplement_combobox').combobox({    
		    url:'is_to_all_depts',    
		    valueField:'DEFIDE_ID',    
		    textField:'DEFIDE_NAME'   
		});
		$('#supplement_combobox').combobox({
			onSelect:function(record){
				var Setext = $("#supplement_text").textbox("setValue","");
				var dName=record.DEFIDE_NAME;
				$("#one_shet").datagrid({url:"is_to_dept_emp_alls?dName="+dName,method:'get'});
				$("#one_shet").datagrid("reload");
			}
		});
		
		$("#supplement_button").linkbutton({
			onClick:function(){
				$('#supplement_combobox').combobox("setValue","");
				var Setext = $("#supplement_text").textbox("getText");
				$("#one_shet").datagrid({url:"is_to_all_emp_mohu?stainName="+Setext,method:'get'});
				$("#one_shet").datagrid("reload");
			}
		});
	</script>

	<div id="shetsuper" class="easyui-panel"
		data-options="fit:true,border:false">
		<div style="margin: 15px">
			<div id="insert_bt" class="insert_bt" style="margin: 10px">
				<a href="#" class="easyui-linkbutton returnet" iconCls="icon-reload"
					plain="true" title="返回" data-options="text:'返回'"></a> <a
					class="easyui-linkbutton submit_sheet_addsuper"
					data-options="text:'添加',iconCls:'icon-add',plain:true"></a> <span
					style="float: right; font-size: 12px; margin-top: 5px;margin-right: 10px;">新增：请假确认</span>
			</div>

			<div style="font-size: 14px;">概要</div>
			<div
				style="border-top: 2px solid #19aa8d; width: 400px; height: 180px; display: inline-block;">
				<table cellspacing="10">
					<tbody>
						<tr>
							<td><input class="easyui-textbox" id="sheet_user_zhi"
								data-options="label:'*员工编号', width:300,labelWidth:130" /></td>
							
						</tr>
						<tr>
							<td><input class="easyui-textbox" id="sheet_user_name"
								data-options="label:'*员工名称', width:300,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input id="leasheet" class="easyui-combobox" name="dept"
								data-options="label:'假种', valueField:'holidayId',textField:'holidayName',url:'find_all_holidayno',plain:true,panelHeight:'auto',width:300,labelWidth:130"
								value="请选择" /></td>
						</tr>
						<tr>
							<td><input id="affcaet" class="easyui-combobox" name="affcaname"
								data-options="label:'事务类别', valueField:'affcaId',textField:'affcaType',url:'find_all_buban',plain:true,panelHeight:'auto',width:300,labelWidth:130"
								value="请选择" /></td>

						</tr>
						
					</tbody>
				</table>
			</div>
			<div
				style="border-top: 2px solid #19aa8d; height: 180px; width: 400px; display: inline-block; margin-left: 10px">
				<table cellspacing="10">
					<tbody>
						<tr>
							<td><input id="tweee" class="easyui-datetimebox"
								data-options="label:'*开始假日', width:350,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input id="oneee" class="easyui-datetimebox"
								data-options="label:'*结束假日', width:350,labelWidth:130" /></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div style="font-size: 14px;">原因</div>
			<div
				style="border-top: 2px solid #19aa8d; width: 800px; height: 130px; display: inline-block; margin-right: 15px; padding-top: 10px;">
				<input id="yuanyings" class="easyui-textbox"
					data-options="width:800,height:100,multiline:true" />
			</div>
			<!--dialog1-->
			<!--清单查找-->
			<div id="findemp" class="easyui-dialog"
				data-options="
		width:450,
		title:'清单查找-考勤员工',
		bodyCls:'awby',
		modal:true,
		closed:true,
		buttons:[{
				text:'添加',
				iconCls:'icon-ok',
				handler:function(){
					$('#f1').form({
							onSubmit:function(){
								//验证表单
								return $(this).form('validate');
								<!-- row获取选中行 -->
								var row=$('#shetsuper').datagrid('getSelected');
								<!-- paperinsertid获取行id，paperinsertname获取行name -->
								var paperinsertid=row.STAIN_ID;
								var paperinsertname=row.STAIN_NAME;
								$('#sheet_user_zhi').textbox('setValue',paperinsertid);
								$('#sheet_user_name').textbox('setValue',paperinsertname);
							},
							success:function(v){
								$.messager.alert('提示','恭喜，添加成功！');
								$('#findemp').dialog('close');
								location.reload();
							}
						}).submit();
				}
			},{
				text:'继续添加',
				handler:function(){
					$('#f1').form('reset');
				}
			},{
				text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
					$('#findemp').dialog('close');
				}
			}]">
				<div>
					<form action="">
						<table >
							<tr>
								<td><input id="supplement_text" class="easyui-textbox"
									data-options="label:'员工', width:200,labelWidth:60" /></td>
									<td><a id="supplement_button" class="easyui-linkbutton">模糊查询</a></td>
							</tr>
							<tr>
								<td><input id="supplement_combobox" class="easyui-combobox"
									data-options="label:'部门', width:200,labelWidth:60,panelHeight:'auto'" /></td>
							</tr>
							
						</table>
					</form>
				</div>
				<table class="easyui-datagrid" id="one_shet"
					data-options="   
				method:'post',
				pagination:true,     
				pageSize:5,   
				url:'is_to_all_staffanddept',  
				pageList: [5,10,15,20,25], 
				rownumbers:true,
				Striped:true, 
				singleSelect:true,
				striped:true
				">
					<thead>
						<tr>
						<th data-options="field:'STAIN_ID',width:100,align:'center'">编号</th>
							<th data-options="field:'STAIN_NAME',width:100,align:'center'">名称</th>
							<th data-options="field:'DEFIDE_NAME',width:100,align:'center'">部门</th>
						</tr>
					</thead>
					<tbody>

					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>